home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Classes / 2.0_nxyPalette1.2 / src / NXYInspector.m < prev    next >
Encoding:
Text File  |  1992-05-26  |  3.0 KB  |  130 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "NXYInspector.h"
  5. #import "Plot.h"
  6. #import "NXYView.h"
  7. #import <appkit/Application.h>
  8. #import <appkit/Panel.h>
  9. #import <appkit/ButtonCell.h>
  10. #import <appkit/Button.h>
  11. #import <appkit/FormCell.h>
  12. #import <appkit/Form.h>
  13.  
  14. #import <nib/InterfaceBuilder.h>
  15.  
  16.  
  17. @implementation NXYInspector
  18.  
  19. + finishLoading:(struct mach_header *)header 
  20. {
  21.     NIBDidLoadClass(self, header);
  22.     return nil;
  23. }
  24.  
  25. + startUnloading 
  26. {
  27.     NIBWillUnloadClass(self);
  28.     return nil;
  29. }
  30.  
  31. - init
  32. {
  33.  
  34.     [super init];
  35.     [NXApp loadNibSection:"NXYInspector.nib" owner:self];
  36.     return self;
  37. }
  38.  
  39. - ok:sender
  40. {
  41.     [object setGrid:[gridSwitch state]];
  42.  
  43.     [object setBorder:[borderSwitch state]];
  44.  
  45.     [object setLogoFlag:[logoSwitch state]];
  46.     
  47.     if([autoMaxMinSet state] == 0){
  48.         [object setXincValue:[xincValue floatValue]];
  49.         [object setXminValue:[xminValue floatValue]];
  50.         [object setXmaxValue:[xmaxValue floatValue]];
  51.         [object setYincValue:[yincValue floatValue]];
  52.         [object setYminValue:[yminValue floatValue]];
  53.         [object setYmaxValue:[ymaxValue floatValue]];
  54.         [object setAutoMaxMinState:NO];
  55.         }
  56.     else
  57.         [object setAutoMaxMinState:YES];
  58.  
  59.     [object setXaxisLabel:[titleLabelForm stringValueAt:0]];
  60.     [object setYaxisLabel:[titleLabelForm stringValueAt:1]]; 
  61.     [object setMainTitle:[titleLabelForm stringValueAt:2]]; 
  62.     
  63.     switch([paperTypeSel selectedRow])
  64.     {
  65.         case 0:
  66.             [object setXLinLogState:LINEAR];
  67.             [object setYLinLogState:LINEAR];
  68.             [object setAutoPaperState:NO];
  69.             [object setPaperSwitchRow:0];
  70.             break;
  71.         case 1:
  72.             [object setXLinLogState:LINEAR];
  73.             [object setYLinLogState:LOG];
  74.             [object setAutoPaperState:NO];
  75.             [object setPaperSwitchRow:1];
  76.             break;
  77.         case 2:
  78.             [object setXLinLogState:LOG];
  79.             [object setYLinLogState:LINEAR];
  80.             [object setAutoPaperState:NO];
  81.             [object setPaperSwitchRow:2];
  82.             break;
  83.         case 3:
  84.             [object setXLinLogState:LOG];
  85.             [object setYLinLogState:LOG];
  86.             [object setAutoPaperState:NO];
  87.             [object setPaperSwitchRow:3];
  88.             break;                        
  89.         default:
  90.             [object setAutoPaperState:YES];
  91.             [object setPaperSwitchRow:4];
  92.             break;
  93.     }
  94.  
  95.     return [super ok:sender];  // Somehow this forces a redraw of the view
  96. }
  97.  
  98. - revert:sender
  99. {
  100.     // Give the nxyView a pointer to its inspector.    
  101.     [object setInspector:self];
  102.  
  103.     [gridSwitch setState:[object gridState]];
  104.     [borderSwitch setState:[object borderState]];
  105.     [logoSwitch setState:[object logoFlag]];
  106.     
  107.     [paperTypeSel setState:1 at:[object paperSwitchRow] :0];
  108.  
  109.     [autoMaxMinSet setState:[object autoMaxMinState]];
  110.     if([object autoMaxMinState] == 0){
  111.     [xincValue setFloatValue:[object xIncValue]];
  112.     [xminValue setFloatValue:[object xMinValue]];
  113.     [xmaxValue setFloatValue:[object xMaxValue]];
  114.     [yincValue setFloatValue:[object yIncValue]];
  115.     [yminValue setFloatValue:[object yMinValue]];
  116.     [ymaxValue setFloatValue:[object yMaxValue]];
  117.     }
  118.         
  119.     [titleLabelForm setStringValue:[object xaxisLabel] at:0];
  120.     [titleLabelForm setStringValue:[object yaxisLabel] at:1];
  121.     [titleLabelForm setStringValue:[object mainTitle] at:2];
  122.     
  123.     return [super revert:sender];
  124.  
  125. }
  126.  
  127.  
  128.  
  129. @end
  130.